<div id="content-header">
    <div id="breadcrumb"> 
    	<a ui-sref="home.sale" title="Go to Home" class="tip-bottom">
    		<i class="icon-home"></i> 销售合同</a> 
    		<a ui-sref="home.contractPay({cid:cid,page:pageNum})" class="current">收款明细
    	</a> 
    </div>
  </div>
  <div class="col-sm-12 col-md-5" style="padding-top: 50px;width: 100%	;">
	<!--<div class="dt-buttons btn-group">
		<a class="btn btn-primary buttons-copy buttons-html5" tabindex="0" aria-controls="datatable-buttons" href="#"><span>Copy</span></a>
		<a class="btn btn-success buttons-excel buttons-html5" tabindex="0" aria-controls="datatable-buttons" href="#"><span>Excel</span></a>
		<a class="btn btn-danger buttons-pdf buttons-html5" tabindex="0" aria-controls="datatable-buttons" href="#"><span>PDF</span></a>
	</div>-->
	<button ng-click="columnAdd('','add')" class="btn  btn-primary btnheight">添加</button>
	 <button ng-click="rement()" class="btn  btn-primary btnheight">返回</button>
	 <!--<button ui-sref="home.feeSubject" class="btn  btn-primary btnheight">模板下载</button>-->
	<div class="col-md-13">
		<div id="datatable-buttons_filter" class="dataTables_filter" >
			<label style="float: left;">
				<input type="search" ng-model="key" class="form-control inputweight" 
					placeholder="" aria-controls="datatable-buttons">
					<button  class="btn  btn-primary btnheight btn-inquiry" ng-click="search(pageNum)">查询</button>
			</label>
		</div>
	</div>
</div>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
 
			<div class="widget-box">
          <div class="widget-content nopadding">
            <table class="table table-bordered data-table">
              <thead>
                <tr>
                  <th width="10%">合同名称</th>
                  <th width="10%">项目编号</th>
                  <th width="10%">收款负责人</th>
                  <th width="10%">收款阶段</th>
                  <th >收款金额</th>
                   <th >收款类型</th>
                   <th >收款时间</th>
                  <th width="15%">操作</th>
                </tr>
              </thead>
              <tbody>
                <tr class="gradeX" bindonce ng-repeat="o in list">
                  <td bo-text="o.contractId"></td>
                  <td bo-text="o.contractId"></td>
                  <td bo-text="o.cpResponsible"></td>
                   <td bo-text="o.cpStage"></td>
                   <td bo-text="o.cpAmount"></td>
                   <td bo-text="o.typeName"></td>
                  <td bo-text="o.cpPayTime|date:'yyyy-MM-dd'"></td>
                  <td>
                  	<button ng-click="columnAdd(o.cpId,'up')" class="btn  btn-primary">修改</button>
                  	<button class="btn  btn-danger" ng-click="modelClick(o.cpId)">删除</button>
                  </td>
                </tr>
                 <tr class="gradeX"  ng-if="totalSize==0||totalSize==undefined"  class="even">
	            	<td colspan="8"> 暂无数据</td>
	           	</tr>
              </tbody>
            </table>
            
           
          </div>
        </div>
         <div class="fy" ng-if="totalSize>0">
									<p>共<span>{{totalSize}}</span>条记录，<span>{{pageNum}}</span>/<span>{{totalNum}}</span>页</p>
									<ul uib-pagination 
										first-text="首页" 
										last-text='末页' 
										next-text='下一页' 
										previous-text='上一页' 
										total-items="totalSize" 
										items-per-page='pageSize' 
										boundary-link-numbers='true' 
										max-size='3' boundary-links='true' 
										ng-model="$parent.tj.current" 
										ng-change='search(tj.current)'>
									</ul>
									<p>到第<input placeholder="{{pageNum}}" ng-change="pageUp()" ng-model="$parent.tj.page" />页</p>
									<span ng-click="toPage($parent.tj.page)">前往</span>
			</div>
					
      </div>
    </div>
 </div>
 
<script type="text/ng-template" id="contractPayAdds.html">
			<style>
				.modal-content{
					width: 600px;
					margin-left: 180px;
				}
				.table_input{
					width:256px;text-indent: .1rem;height: 36px;
				}
				.table_span{
					display: block;width:100px;
				}
				.datetimepicker{
					position: absolute;
					margin-left: 130px;
				}

			</style>
			<div class="modal-header" style="text-align: center;font-size: 24px;background: #4092E8;color: white;height:50px;line-height: 50px">
				<div style="margin-top: -8px;">
					{{sername}}
				</div>
				<button style="color:white;float: right;background: #4092e8;border: none;outline: none;box-shadow: none;margin-top: -35px;" class="btn " type="button" ng-click="cancel()">[关闭]</button>
			</div>
			<div class="modal-body" >
				<div class="adduser" >
					<div style="    margin-left: 40px;">
						<form novalidate="novalidate" name="form">
							<div style="margin: 10px 0;display: flex;align-items: center;">
								<span class="table_span" >收款负责人：</span>
								<input class="table_input" autocomplete="off"   type="text" value="" name="cpResponsible" ng-model="param.cpResponsible" required>
								<span class="error bigError "  ng-show="form.cpResponsible.$error.required" style="font-size: 18px;font-weight: bold;">*</span>
							</div>
							<div style="margin: 10px 0;display: flex;align-items: center;">
								<span class="table_span" >收款阶段：</span>
								<input class="table_input"  autocomplete="off"   type="text" value="" name="cpStage" ng-model="param.cpStage" >
							</div>
							<div style="margin: 10px 0;display: flex;align-items: center;">
								<span class="table_span" >收款金额：</span>
								<input class="table_input"  autocomplete="off"  type="text" value="" name="cpAmount" ng-model="param.cpAmount" 
									ng-pattern="/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/" required >
								<span class="error bigError "  ng-show="form.cpAmount.$error.required" style="font-size: 18px;font-weight: bold;">*</span>
								<span class="error bigError "  ng-show="form.cpAmount.$error.pattern" style="font-size: 18px;font-weight: bold;">金额格式错误</span>
							</div>
							<div style="margin: 10px 0;display: flex;align-items: center;">
								<span class="table_span" >收款类型：</span>
								<select  class="table_input"  ng-model="param.cpType"  
                    			ng-options="o.diId as o.diName for o in param.paymentDic"></select>
							</div>
							<div style="margin: 20px 0;display: flex;align-items: center;">
								<span class="table_span" >收款时间：</span>
								<model-picker class="datetimepicker"  ng-model="pickertime" ></model-picker>
							</div>
							
						</form>

					</div>
				</div>
			</div>
			<div class="modal-footer" style="position: relative;height:50px;">
				<div style="display: flex;justify-content: flex-end;padding: 0;position: absolute;right: 20px;top: 0.1rem;">
					
					<button  class="" ng-disabled="form.$invalid" ng-class="{true:'btn btn-primary'}[form.$invalid]" 
						style="width: 100px;border-radius: 0;line-height: 32px;background-color:#4092e8 ;border:#4092e8 ; font-size: 13px;color: white;font-size: 14px;margin-top: 5px;"
						ng-click="ok(form.$invalid)">保 存</button>
				</div>
			</div>
		</script>
